package com.rmt.www.action;

import java.util.List;
import org.apache.struts2.ServletActionContext;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.rmt.www.dao.ArtifactDao;
import com.rmt.www.dao.ProjectDao;
import com.rmt.www.dao.RequestDao;
import com.rmt.www.dao.UserDao;
import com.rmt.www.service.AdminManageChangeService;
import com.rmt.www.service.AdminManageProjectService;
import com.rmt.www.service.DevManageDesignService;
import com.rmt.www.utility.SystemTime;
import com.rmt.www.vo.Artifact;
import com.rmt.www.vo.Project;
import com.rmt.www.vo.Request;
import com.rmt.www.vo.User;


public class EditProjectAction extends ActionSupport{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String title;
	private String description;
	private AdminManageProjectService adminManageProjectService;
	
	public AdminManageProjectService getAdminManageProjectService() {
		return adminManageProjectService;
	}
	public void setAdminManageProjectService(
			AdminManageProjectService adminManageProjectService) {
		this.adminManageProjectService = adminManageProjectService;
	}
	
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	
	private int pid;
	
	public int getPid() {
		return pid;
	}
	public void setPid(int pid) {
		this.pid = pid;
	}
	public String execute(){
		Project project = adminManageProjectService.getProject(pid);
		project.setTitle(title);
		project.setDescription(description);
		adminManageProjectService.updateNewProject(project);
		return "success";
	}
}
